import request from '../utils/request'
import {getGuid} from '../utils/common'
// 问答
export function askQuestion(data) {
  return request({
    url: '/AIApi/AILibrarian/AskQuestion',
    method: 'post',
    data
  })
}
// 问答2
export function askQuestionV2(data) {
  let appId = 'eEGrC9SDOvRdlkdUhCZAgjkWXuabkcfu'
  let secretKey = '4KCQXG98DNIVin4nUpqnOrsve9unhCyR'
  let url = `https://agentapi.baidu.com/assistant/getAnswer?appId=${appId}&secretKey=${secretKey}`
  data.source = appId
  data.from = 'openapi'
  data.openId = getGuid()
  return request({
    url,
    method: 'post',
    data
  })
}
// 运动轨迹添加
export function addMoving(data) {
  return request({
    url: '/RobotGuidingApi/MovingTrail/AddUpdate',
    method: 'post',
    data
  })
}
// 运动轨迹查询
export function movingList(data) {
    return request({
      url: '/RobotGuidingApi/MovingTrail/List',
      method: 'post',
      data
    })
}

// 心跳检测
export function heartBeat(data) {
  return request({
    url: '/RobotGuidingApi/Device/Heartbeat',
    method: 'post',
    data
  })
}

// 设备注册
export function deviceRegister(data) {
  return request({
    url: '/RobotGuidingApi/Device/Register',
    method: 'post',
    data
  })
}
